﻿using System;
using System.Windows.Forms;

namespace Inaction.UI.Extensions.ControlExtensions.Grid
{
    public partial class ChangeCaptionForm : Form
    {
        public string Caption { get { return tb_NewCaption.Text.Trim(); } }

        public ChangeCaptionForm(string oldCaption)
        {
            InitializeComponent();
            tb_OldCaption.Text = oldCaption;
        }

        private void btn_Confirm_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(tb_NewCaption.Text))
            {
                DialogResult = System.Windows.Forms.DialogResult.Yes;
                Close();
            }
        }

        private void btn_Cancel_Click(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.No;
            Close();
        }
    }
}
